<!DOCTYPE html>
{% load myfilter  %}
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>栏目添加</title>
    <link rel="stylesheet" href="{% static 'common/css/table.css' %}">
</head>
    {% include "inc/top.html" with title='栏目列表' %}
    <table class="mytable">
        <tr><td>
            {% include "category/inc.html" %}
        </td></tr>
    </table>
    <form action="{% url 'category.add' %}" method="post">
    {% csrf_token %}
    <table class="mytable">
        <tbody>
        <tr>
            <td>栏目名称</td>
            <td><input type="text" name="name"/> </td>
        </tr>
        <tr>
            <td>栏目类型</td>
            <td>
                <select name="type">
                    {% for t in types %}
                        <option value="{{ t.id }}">{{ t.name }}</option>
                    {% endfor %}
                </select>
            </td>
        </tr>
        <tr>
            <td>是否导航</td>
            <td><input type="radio" name="is_nav" value="1"/> 是<input type="radio" name="is_nav" value="0" checked/> 否 </td>
        </tr>
        <tr>
            <td>是否首页</td>
            <td><input type="radio" name="is_index" value="1"/> 是<input type="radio" name="is_index" value="0" checked/> 否 </td>
        </tr>
        <tr>
            <td>超链接</td>
            <td><input type="text" name="href"/> </td>
        </tr>
        <tr>
            <td>排序号</td>
            <td><input type="text" name="orders"/> </td>
        </tr>
        <tr>
            <td>父栏目</td>
            <td>
                <select name="pid" id="">
                    <option value="0">请选择父栏目</option>
                    {% for p in ps %}
                        <option value="{{ p.id }}">{{ p.name }}</option>
                    {% endfor %}
                </select>
            </td>
        </tr>
        <tr>
            <td colspan="2" align="center">
                <input type="submit" value="添加栏目">
                <input type="reset" value="重置">
            </td>
        </tr>
        </tbody>
    </table>
    </form>
</body>
</html>